<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <xsd:element name="Entity">
      <xsd:complexType>
         <xsd:sequence>
            
            <xsd:element name="Include" 
                         minOccurs="0" maxOccurs="unbounded">
               <xsd:complexType>
                  <xsd:attribute name="file" type="xsd:string" />
               </xsd:complexType>
            </xsd:element>
            
            <xsd:element name="Draw"
                         minOccurs="0" maxOccurs="1">
               <xsd:complexType>
                  <xsd:sequence>
                     <xsd:element name="Resource">
                        <xsd:complexType>
                           <xsd:attribute name="fname" type="xsd:string" />
                        </xsd:complexType>
                     </xsd:element>
                     
                     <xsd:element name="Blending">
                        <xsd:complexType>
                           <xsd:attribute name="color" type="xsd:string" use="required"/>
                           <xsd:attribute name="method" type="xsd:string" use="required"/>
                        </xsd:complexType>
                     </xsd:element>
                     <xsd:choice minOccurs="0">
                        <xsd:element name="AnimationTable">
                           <xsd:complexType>
                              <xsd:sequence>
                                 <xsd:element name="Animation"
                                              minOccurs="1" maxOccurs="unbounded" >
                                    <xsd:complexType>
                                       <xsd:attribute name="name" type="xsd:string" use="required"/>
                                       <xsd:attribute name="as" type="xsd:string" />
                                       <xsd:attribute name="startRect" type="xsd:string" />
                                       <xsd:attribute name="frames" type="xsd:integer" />
                                       <xsd:attribute name="time" type="xsd:integer"/>
                                       <xsd:attribute name="flipX" type="xsd:boolean"/>
                                       <xsd:attribute name="flipY" type="xsd:boolean"/>
                                    </xsd:complexType>
                                 </xsd:element>
                              </xsd:sequence>
                              <xsd:attribute name="default" type="xsd:string" use="required"/>
                              <xsd:attribute name="offset" type="xsd:string" use="required"/>
                           </xsd:complexType>
                        </xsd:element>
                     </xsd:choice>
                  </xsd:sequence>
                  <xsd:attribute name="scale" type="xsd:string" />
                  <xsd:attribute name="flipX" type="xsd:boolean" />
                  <xsd:attribute name="flipY" type="xsd:boolean" />
               </xsd:complexType> 
            </xsd:element>
            
            <xsd:element name="Physics"
                         minOccurs="0" maxOccurs="1">
               <xsd:complexType>
                  <xsd:sequence>
                     <xsd:element name="Mass">
                        <xsd:complexType>
                           <xsd:attribute name="value" type="xsd:decimal" />
                           <xsd:attribute name="CoG" type="xsd:string" />
                           <xsd:attribute name="CoI" type="xsd:string" />
                        </xsd:complexType>
                     </xsd:element>
                     <xsd:element name="Rect"
                                  minOccurs="0" maxOccurs="1">
                        <xsd:complexType>
                           <xsd:attribute name="value" type="xsd:string" />
                        </xsd:complexType>
                     </xsd:element>
                     <xsd:element name="Material">
                        <xsd:complexType>
                           <xsd:attribute name="bounce">
                              <xsd:simpleType>
                                 <xsd:restriction base="xsd:decimal">
                                    <xsd:minInclusive value="0.0" />
                                    <xsd:maxInclusive value="1.0" />
                                 </xsd:restriction>
                              </xsd:simpleType>
                           </xsd:attribute>
                           <xsd:attribute name="friction">
                              <xsd:simpleType>
                                 <xsd:restriction base="xsd:decimal">
                                    <xsd:minInclusive value="0.0" />
                                    <xsd:maxInclusive value="1.0" />
                                 </xsd:restriction>
                              </xsd:simpleType>
                           </xsd:attribute>
                        </xsd:complexType>
                     </xsd:element>
                     <xsd:element name="Damping"
                                  minOccurs="0" maxOccurs="1">
                        <xsd:complexType>
                           <xsd:attribute name="value" type="xsd:decimal" />
                           <xsd:attribute name="applyonX" type="xsd:boolean" />
                           <xsd:attribute name="applyonY" type="xsd:boolean" />
                        </xsd:complexType>
                     </xsd:element>
                  </xsd:sequence>
                  <xsd:attribute name="type" type="xsd:string" />
                  <xsd:attribute name="ignoreGeneralForces" type="xsd:boolean" />
                  <xsd:attribute name="canSleep" type="xsd:boolean" />
                  <xsd:attribute name="ghost" type="xsd:boolean" />
               </xsd:complexType>
            </xsd:element>
            
            <xsd:element name="Scripts"
                         minOccurs="0" maxOccurs="1">
               <xsd:complexType>
                  <xsd:sequence>
                     <xsd:element name="Script"
                                  minOccurs="0" maxOccurs="unbounded">
                        <xsd:complexType>
                           <xsd:sequence>
                              <xsd:element name="string"
                                           minOccurs="0" maxOccurs="unbounded">
                                 <xsd:complexType>
                                    <xsd:simpleContent>
                                       <xsd:extension base="xsd:string">
                                          <xsd:attribute name="name" type="xsd:string"/>
                                       </xsd:extension>
                                    </xsd:simpleContent>
                                 </xsd:complexType>
                              </xsd:element>
                              <xsd:element name="int"
                                           minOccurs="0" maxOccurs="unbounded">
                                 <xsd:complexType>
                                    <xsd:simpleContent>
                                       <xsd:extension base="xsd:integer">
                                          <xsd:attribute name="name" type="xsd:string"/>
                                       </xsd:extension>
                                    </xsd:simpleContent>
                                 </xsd:complexType>
                              </xsd:element>
                              <xsd:element name="float"
                                           minOccurs="0" maxOccurs="unbounded">
                                 <xsd:complexType>
                                    <xsd:simpleContent>
                                       <xsd:extension base="xsd:decimal">
                                          <xsd:attribute name="name" type="xsd:string"/>
                                       </xsd:extension>
                                    </xsd:simpleContent>
                                 </xsd:complexType>
                              </xsd:element>
                              <xsd:element name="vector2f"
                                           minOccurs="0" maxOccurs="unbounded">
                                 <xsd:complexType>
                                    <xsd:sequence>
                                       <xsd:element name="x" type="xsd:decimal" />
                                       <xsd:element name="y" type="xsd:decimal" />
                                    </xsd:sequence>
                                    <xsd:attribute name="name" type="xsd:string"/>
                                 </xsd:complexType>
                              </xsd:element>
                           </xsd:sequence>
                           <xsd:attribute name="file" type="xsd:string" />
                        </xsd:complexType>
                     </xsd:element>
                  </xsd:sequence>
               </xsd:complexType>
            </xsd:element>
            
            <xsd:element name="Properties"
                         minOccurs="0" maxOccurs="1">
               <xsd:complexType>
                  <xsd:sequence>
                     <xsd:element name="string"
                                  minOccurs="0" maxOccurs="unbounded">
                        <xsd:complexType>
                           <xsd:simpleContent>
                              <xsd:extension base="xsd:string">
                                 <xsd:attribute name="name" type="xsd:string"/>
                               </xsd:extension>
                           </xsd:simpleContent>
                        </xsd:complexType>
                     </xsd:element>
                     <xsd:element name="int"
                                  minOccurs="0" maxOccurs="unbounded">
                        <xsd:complexType>
                           <xsd:simpleContent>
                              <xsd:extension base="xsd:integer">
                                 <xsd:attribute name="name" type="xsd:string"/>
                               </xsd:extension>
                           </xsd:simpleContent>
                        </xsd:complexType>
                     </xsd:element>
                     <xsd:element name="float"
                                  minOccurs="0" maxOccurs="unbounded">
                        <xsd:complexType>
                           <xsd:simpleContent>
                              <xsd:extension base="xsd:decimal">
                                 <xsd:attribute name="name" type="xsd:string"/>
                               </xsd:extension>
                           </xsd:simpleContent>
                        </xsd:complexType>
                     </xsd:element>
                     <xsd:element name="bool"
                                  minOccurs="0" maxOccurs="unbounded">
                        <xsd:complexType>
                           <xsd:simpleContent>
                              <xsd:extension base="xsd:boolean">
                                 <xsd:attribute name="name" type="xsd:string"/>
                               </xsd:extension>
                           </xsd:simpleContent>
                        </xsd:complexType>
                     </xsd:element>
                     <xsd:element name="vector2f"
                                  minOccurs="0" maxOccurs="unbounded">
                        <xsd:complexType>
                           <xsd:sequence>
                              <xsd:element name="x" type="xsd:decimal" />
                              <xsd:element name="y" type="xsd:decimal" />
                           </xsd:sequence>
                           <xsd:attribute name="name" type="xsd:string"/>
                        </xsd:complexType>
                     </xsd:element>
                  </xsd:sequence>
               </xsd:complexType>
            </xsd:element>
         </xsd:sequence>
        
         <xsd:attribute name="extends" type="xsd:string" />
         <xsd:attribute name="category" type="xsd:string" />
      </xsd:complexType>
   </xsd:element>
</xsd:schema>

